#ifndef MSGTRANDYN_H
#define MSGTRANDYN_H

/* Another layer of front-ends for MsgTrans */

#include "MsgTrans.h"

#include "control.h"

/* Lookup of MessageTrans messages into dynamically allocated buffer;
   if report is FALSE, error is assumed to be lack of token and not reported
 */
char *MsgTransDyn_LookupPS(const msgtrans_filedesc *fd, const char *token,
                           const char *p0, const char *p1,
                           const char *p2, const char *p3,
                           BOOL report);

#define MsgTransDyn_Lookup(fd, t, r) MsgTransDyn_LookupPS((fd), (t), \
                                    NULL, NULL, NULL, NULL, (r))

/* def is default value if token isn't found */
int MsgTransDyn_LookupInt(const msgtrans_filedesc *fd, const char *token,
                          BOOL report, int def);

BOOL MsgTransDyn_LookupBool(const msgtrans_filedesc *fd, const char *token,
                            BOOL report, BOOL def);

control_optional_t MsgTransDyn_LookupOptional(const msgtrans_filedesc *fd,
                                              const char *token);

#endif /* MSGTRANDYN_H */
